import pandas as pd

class Backtester:
    def __init__(self, strategy, data):
        self.strategy = strategy
        self.data = data

    def run_backtest(self):
        signals = self.strategy.generate_signals()
        # 在这里实现回测逻辑，计算策略绩效
        returns = self.data['close'].pct_change()
        strategy_returns = signals['signal'].shift(1) * returns
        cumulative_returns = (1 + strategy_returns).cumprod()
        return cumulative_returns
